package breakout2014;

import com.jme3.input.InputManager;
import com.jme3.math.FastMath;
import com.jme3.math.Vector2f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.control.AbstractControl;


public class BrickMultiHitControl extends AbstractControl {
    int counter;

    public BrickMultiHitControl() {
        counter = 2;
    }
    
    @Override
    protected void controlUpdate(float tpf) {
        if (spatial.getUserData("hit")){
            counter--;
            spatial.setUserData("hit", false);
            
        }
        if (counter <= 0){
            spatial.removeFromParent();
        }
    }

    @Override
    protected void controlRender(RenderManager rm, ViewPort vp) {}
    
}

